﻿using FastExecutor.Base.Design;
using FastExecutor.Base.Util;
using FastExecutor.ORG.Entity;
using FastORM.Applicaiton;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FastExecutor.ORG.DB
{
    public class DB_Config : FastTemplateDB<Frame_Config>
    {
        public override void Insert(Frame_Config Entity)
        {
            Entity.RowGuid = CommonUtil.CreateCommonGuid();
            Entity.AddDate = DateTime.Now;
            base.Insert(Entity);
        }

        public string GetConfigValue(string ConfigName)
        {
            DBRow row = new DBRow("Frame_Config", "ConfigName", ConfigName);
            if (row.IsExist())
            {
                return Convert.ToString(row["ConfigValue"]);
            }
            else
            {
                return string.Empty;
            }
        }
    }
}
